﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PasteCluster
{
    /// <summary>
    /// 
    /// </summary>
    public class PasteSloveMessage
    {
        /// <summary>
        /// 消息时间
        /// </summary>
        public long time { get; set; }

        /// <summary>
        /// 需要传递的消息体
        /// </summary>
        public string body { get; set; }

        /// <summary>
        /// 给某一个组 0表示忽略
        /// </summary>
        public int to_group { get; set; }

        /// <summary>
        /// 消息类型
        /// 0默认消息类型
        /// 1.当前节点成为Master
        /// 2.当前节点成为Cluster PasteNodeModel 找到当前节点，当前节点注册
        /// 3.PasteNodeModel 有新的节点加入
        /// 4.PasteNodeModel 有节点掉线
        /// 5.当前节点失去Master，成为普通Cluster节点
        /// </summary>
        public int msg_type { get; set; } = 0;

        /// <summary>
        /// 
        /// </summary>
        public bool from_api { get; set; } = false;

        /// <summary>
        /// 消息来自哪个节点
        /// </summary>
        public PasteNodeModel from { get; set; }

        /// <summary>
        /// 将要发往哪个节点
        /// </summary>
        public PasteNodeModel to { get; set; }
    }

}
